<html>
<head><meta charset="utf-8"><title>Avoiding Scalar Fallbacks / Verifying Vectorization · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html">Avoiding Scalar Fallbacks / Verifying Vectorization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="233953628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233953628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233953628">(Apr 10 2021 at 13:03)</a>:</h4>
<p>I think it's safe to say that if we're going to favor portability, we also will have to occasionally lower ops to scalar variants on some targets (that's the whole idea, to a certain extent). Lets say I'm using core::simd, and consider this quite undesirable — like, imagine I'm writing a vectorized implementation of something in libcore or libstd, or honestly any performance-oriented crate.</p>
<p>Is there some way I can ensure, possibly via tooling we can provide, that the code will, in fact, run vectorized without hitting scalar fallbacks on a given target. I think the answer is clearly no at the moment, but that seems bad, so can we brainstorm ways this could work? Lets assume we want to have the answer here be better than either "examine the generated code" or "profile it".</p>
<p>Note that non-<code>core</code> simd crates built from non-portable operations can trivially provide these guarantees, by just not supporting the operations. Obviously we can't do that, but if I'm bothering to write something in SIMD, this can defeat the entire point — here's no reason to think of an algorithm that processes 16 bytes at a time in batch operations, if one of those operations happens to just loop over each byte.</p>



<a name="233954710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233954710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233954710">(Apr 10 2021 at 13:19)</a>:</h4>
<p>I'm not sure this is completely reasonable since some operations like Div won't have a vectorized implementation on most architectures.  I think it depends what you mean by vectorized too, what about horizontal reductions that might result in say 3 SIMD instructions instead of 4 scalar ones?</p>



<a name="233954854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233954854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233954854">(Apr 10 2021 at 13:21)</a>:</h4>
<p>I know it's explicitly what you said you don't want to do, but I've definitely had to examine generated code and profile it even when using vendor APIs</p>



<a name="233954962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233954962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233954962">(Apr 10 2021 at 13:23)</a>:</h4>
<p>Anyway, as far as tooling goes, if it were possible I think it would need to be part of LLVM?  Maybe there's some way we could hack it together but in the end we don't have any control over how IR is lowered to instructions</p>



<a name="233964109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964109">(Apr 10 2021 at 15:19)</a>:</h4>
<p>I don't personally mind looking at asm, but it can be easy to miss things, especially in a large vectorized function. Horizontal ops are not what I'm worried about, since if they're being done, it's explicit and at least something you can know to watch out for.</p>



<a name="233964258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964258">(Apr 10 2021 at 15:21)</a>:</h4>
<p>My concern is the end of this that we have a pretty API which is easy to end up being not substantially faster than the scalar version, and for people to have no real path forward for figuring out why. Autovectorization being a perf footgun is why people don't like relying on it, and I'd like this not to be that way at all</p>



<a name="233964275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964275">(Apr 10 2021 at 15:21)</a>:</h4>
<p>Yeah, something that can take a rust function and report that you <em>didn't</em> get the vector version of <code>foo_op</code> that you intended. so a horizontal op that lowers to whatever bad-performing horizontal hardware thing is... what you wrote at least.</p>



<a name="233964334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964334">(Apr 10 2021 at 15:22)</a>:</h4>
<p>but getting 4 libm::sqrt calls is <em>not</em> want you want to see</p>



<a name="233964504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964504">(Apr 10 2021 at 15:25)</a>:</h4>
<p>I feel like that falls on us and not the end user to test</p>



<a name="233964524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964524">(Apr 10 2021 at 15:25)</a>:</h4>
<p>In general the other thing I'd like to avoid is for people to have a good reason to use vendor intrinsics over portable simd, in cases where the vendor intrinsics are (nominally) totally covered by the API.</p>



<a name="233964535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964535">(Apr 10 2021 at 15:25)</a>:</h4>
<p>We know what's going on with sqrt for example and we know how to fix it</p>



<a name="233964607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964607">(Apr 10 2021 at 15:26)</a>:</h4>
<p><span class="user-mention" data-user-id="209168">@Thom Chiovoloni</span> is your concern that for some reason LLVM might generate addss instead of vaddps?</p>



<a name="233964608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964608">(Apr 10 2021 at 15:26)</a>:</h4>
<p>Ehhhh, I think it falls on us to provide an API either without that sort of footgun or that at least provides a way to detect it. It doesn't take many times getting bit by something like that before you just give up on the thing and do the way that can't bite you.</p>



<a name="233964619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964619">(Apr 10 2021 at 15:26)</a>:</h4>
<p>not at all</p>



<a name="233964709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964709">(Apr 10 2021 at 15:28)</a>:</h4>
<p>no, it's that i'll call a function that isn't supported in a vectorized way on the platform, or that has a <code>blah.iter()...</code> loop inside its body in the rust for some reason (i saw we had one on i586 for some function and thought "huh that seems like quite a footgun")</p>



<a name="233964743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964743">(Apr 10 2021 at 15:29)</a>:</h4>
<p>but it wasnt until today when i was picking up a patch for libcore, and thought "this could be vectorized" when i thought about this, mostly because if i'm going to take the time to write it, and the libs team is going to bother having the more complex code like that in there</p>



<a name="233964749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964749">(Apr 10 2021 at 15:29)</a>:</h4>
<p>it needs to be doing what it thinks its doing</p>



<a name="233964750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964750">(Apr 10 2021 at 15:29)</a>:</h4>
<p>So that is there on i586 to avoid some weird issues with 80-bit floats.  That only occurs on platforms that don't have SSE anyway</p>



<a name="233964756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964756">(Apr 10 2021 at 15:29)</a>:</h4>
<p>sure, i wasn't super worried about that particuar case</p>



<a name="233964759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964759">(Apr 10 2021 at 15:29)</a>:</h4>
<p>we have other cases where we have scalar loops thouhg</p>



<a name="233964812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964812">(Apr 10 2021 at 15:30)</a>:</h4>
<p>We do?</p>



<a name="233964821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964821">(Apr 10 2021 at 15:30)</a>:</h4>
<p>uh, do we not anymore</p>



<a name="233964835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964835">(Apr 10 2021 at 15:30)</a>:</h4>
<p>I don't think we have any</p>



<a name="233964842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964842">(Apr 10 2021 at 15:30)</a>:</h4>
<p>either way, LLVM will definitely emit those for unhandled things</p>



<a name="233964859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964859">(Apr 10 2021 at 15:30)</a>:</h4>
<p>Yeah of course, like integer division on nearly every platform</p>



<a name="233964861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964861">(Apr 10 2021 at 15:30)</a>:</h4>
<p>right</p>



<a name="233964887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964887">(Apr 10 2021 at 15:31)</a>:</h4>
<p>nothing we can do about that, but perhaps we can somehow provide some tooling that either peeks at IR or something</p>



<a name="233964948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964948">(Apr 10 2021 at 15:32)</a>:</h4>
<p>I'm just not sure that whether or not it uses a vector op is the right question most of the time, a vectorized square root will still be slower than say some non-vectorized shuffle</p>



<a name="233964971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964971">(Apr 10 2021 at 15:32)</a>:</h4>
<p>yes, but if i told it to do the vectorized sqrt</p>



<a name="233964977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964977">(Apr 10 2021 at 15:32)</a>:</h4>
<p>its doing what i said and that problem with the code is obvious</p>



<a name="233964980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964980">(Apr 10 2021 at 15:32)</a>:</h4>
<p>in that its in the source</p>



<a name="233964988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233964988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233964988">(Apr 10 2021 at 15:32)</a>:</h4>
<p>i mean it almost feels like a thing we could have as a lint, where we just know which targets support what things. but that probably gets too unmanagable when you consider target features and such</p>



<a name="233965038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965038">(Apr 10 2021 at 15:33)</a>:</h4>
<p>My concern with that is that you didn't tell it to do a vectorized square root, you told it to do a square root on a vector and try its best</p>



<a name="233965105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965105">(Apr 10 2021 at 15:34)</a>:</h4>
<p>sure, it's still doing what you told it to do</p>



<a name="233965124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965124">(Apr 10 2021 at 15:34)</a>:</h4>
<p>Inevitably certain things in many SIMD algorithms will not be vectorized because they can't be</p>



<a name="233965181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965181">(Apr 10 2021 at 15:35)</a>:</h4>
<p>Also I usually multiversion functions so one variant will inevitably have no or minimal vector ops I think</p>



<a name="233965182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965182">(Apr 10 2021 at 15:35)</a>:</h4>
<p>hm? for a large class of SIMD algorithms the entire speedup comes from processing things entirely in <code>lane</code> items at a time, and as soon as you add a fully scalar operation you end up wiht almost no benefit to using simd</p>



<a name="233965294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965294">(Apr 10 2021 at 15:37)</a>:</h4>
<p>Of course but there are plenty of algorithms that aren't fully parallel that still benefit from SIMD</p>



<a name="233965398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965398">(Apr 10 2021 at 15:38)</a>:</h4>
<p>My point is that I don't think the compiler is smart enough to figure that out a lot of the time, and I don't think it's reasonable to put a bunch of #[allow] or whatever to silence those false alarms</p>



<a name="233965421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965421">(Apr 10 2021 at 15:39)</a>:</h4>
<p>well, sure, but i think the fully parallel ones are probably more common, and even if not, they're the ones hurt most by having something surprisingly iterating over each lane</p>



<a name="233965425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965425">(Apr 10 2021 at 15:39)</a>:</h4>
<p>oh if it were a lint it would be allow by default</p>



<a name="233965434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965434">(Apr 10 2021 at 15:39)</a>:</h4>
<p>you'd only turn it on when you wanted to check this stuff</p>



<a name="233965513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965513">(Apr 10 2021 at 15:40)</a>:</h4>
<p>a separate tool would be fine</p>



<a name="233965559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965559">(Apr 10 2021 at 15:41)</a>:</h4>
<p>I guess what I'm thinking is that since we're targeting a minimal SIMD subset there's no reason to suspect it will ever generate truly scalar ops (once we sort out the libm problem) except for Div</p>



<a name="233965656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965656">(Apr 10 2021 at 15:42)</a>:</h4>
<p>i just want to avoid a situation where the best practice for high perf simd code ends up being using core::arch for everything, because the stdsimd api is too unreliable</p>



<a name="233965892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965892">(Apr 10 2021 at 15:46)</a>:</h4>
<p>Yeah definitely.  I think that's prevented by our choice of functions though</p>



<a name="233965973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965973">(Apr 10 2021 at 15:47)</a>:</h4>
<p>hmm, i think we have a lot of things that are not supported in vectorized ways by all arches</p>



<a name="233965989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233965989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233965989">(Apr 10 2021 at 15:47)</a>:</h4>
<p>Do you have a specific example you're concerned about?</p>



<a name="233966029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966029">(Apr 10 2021 at 15:48)</a>:</h4>
<p>Nothing comes to mind to me</p>



<a name="233966189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966189">(Apr 10 2021 at 15:51)</a>:</h4>
<p>hm, i guess we'll see. i think there are a lot of sse2 examples. but maybe its not <em>that</em> bad</p>



<a name="233966423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966423">(Apr 10 2021 at 15:54)</a>:</h4>
<p>I think there are a bunch that correspond to libm functions but that's more of a problem with our codegen and not some fundamental reason they can't be vector ops</p>



<a name="233966438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966438">(Apr 10 2021 at 15:54)</a>:</h4>
<p>i think the libm problem is separate</p>



<a name="233966451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966451">(Apr 10 2021 at 15:55)</a>:</h4>
<p>Agreed, just making sure</p>



<a name="233966465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966465">(Apr 10 2021 at 15:55)</a>:</h4>
<p>i'm imagining the future world in which we solve the libm problem</p>



<a name="233966475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966475">(Apr 10 2021 at 15:55)</a>:</h4>
<p>because i cant bear to imagine the future where we dont</p>



<a name="233966481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966481">(Apr 10 2021 at 15:55)</a>:</h4>
<p>or well</p>



<a name="233966563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966563">(Apr 10 2021 at 15:56)</a>:</h4>
<p>Haha I'll PR LLVM myself if that's what it takes</p>



<a name="233966568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966568">(Apr 10 2021 at 15:56)</a>:</h4>
<p>I looked over the float API and I don't think there's anything there that couldn't work with SSE2</p>



<a name="233966589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966589">(Apr 10 2021 at 15:57)</a>:</h4>
<p>Integer too</p>



<a name="233966597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966597">(Apr 10 2021 at 15:57)</a>:</h4>
<p>Really the only weird things are if your platform doesn't have saturating integer math, or if you try to do a nasty shuffle</p>



<a name="233966610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966610">(Apr 10 2021 at 15:58)</a>:</h4>
<p>or at least the future where we dont solve it should be the future were we come up with a special case hack for floor/round and such, and then dont provide fancy functions</p>



<a name="233966667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966667">(Apr 10 2021 at 15:58)</a>:</h4>
<p>but that would suck</p>



<a name="233966669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966669">(Apr 10 2021 at 15:58)</a>:</h4>
<p>Yep</p>



<a name="233966699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966699">(Apr 10 2021 at 15:59)</a>:</h4>
<p>I clicked through the docs and I can't imagine any SIMD instruction set that doesn't have these operations</p>



<a name="233966845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233966845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233966845">(Apr 10 2021 at 16:00)</a>:</h4>
<p>Unless it's something like SSE and just doesn't have integer operations at all</p>



<a name="233973366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973366">(Apr 10 2021 at 17:40)</a>:</h4>
<p>sse absolutely has integer operations</p>



<a name="233973384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973384">(Apr 10 2021 at 17:40)</a>:</h4>
<p>they're just not the integer operations that you want</p>



<a name="233973411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973411">(Apr 10 2021 at 17:41)</a>:</h4>
<p>unless what you want to do is like, motion estimation for some video codec</p>



<a name="233973502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973502">(Apr 10 2021 at 17:42)</a>:</h4>
<p>but i'll have you know i used <code>_mm_madd_epi16</code> very recently, and even thought "damn, i'll have to come up with another way to do this on non-intel"</p>



<a name="233973504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973504">(Apr 10 2021 at 17:42)</a>:</h4>
<p>I thought not a single integer vector operation came until SSE2</p>



<a name="233973509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973509">(Apr 10 2021 at 17:42)</a>:</h4>
<p>oh maybe sse2</p>



<a name="233973526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973526">(Apr 10 2021 at 17:43)</a>:</h4>
<p>sorry, i forgot that SSE existed on its own since yeah its practically useless</p>



<a name="233973529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973529">(Apr 10 2021 at 17:43)</a>:</h4>
<p>Lol. Agreed</p>



<a name="233973685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233973685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233973685">(Apr 10 2021 at 17:45)</a>:</h4>
<p>I think SSE and arm v6 SIMD served the same purpose, providing IEEE floats with SIMD tacked on and ignoring integer SIMD</p>



<a name="233975713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233975713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233975713">(Apr 10 2021 at 18:20)</a>:</h4>
<p>I've never heard of an integer</p>



<a name="233991142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/233991142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#233991142">(Apr 10 2021 at 21:35)</a>:</h4>
<p>what's an integer?</p>



<a name="234951635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234951635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234951635">(Apr 17 2021 at 02:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/stdsimd/issues/76#issuecomment-821749814">https://github.com/rust-lang/stdsimd/issues/76#issuecomment-821749814</a> optimizer go brrr</p>



<a name="234952198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234952198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234952198">(Apr 17 2021 at 02:26)</a>:</h4>
<p>Hmm that's a change in LLVM 12 I assume?</p>



<a name="234952315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234952315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234952315">(Apr 17 2021 at 02:28)</a>:</h4>
<p>probably</p>



<a name="234953080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234953080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234953080">(Apr 17 2021 at 02:42)</a>:</h4>
<p>wow, aarch64 really just... handles this like a boss:</p>
<div class="codehilite" data-code-language="a64asm"><pre><span></span><code>&lt;&amp;T as core::fmt::Debug&gt;::fmt:
        ldr     x0, [x0]
        b       _ZN4core3fmt5float50_$LT$impl$u20$core..fmt..Debug$u20$for$u20$f32$GT$3fmt17h68f66863527610f0E

core::ptr::drop_in_place&lt;&amp;f32&gt;:
        ret

example::f32x4::ceil:
        ldr     q0, [x0]
        frintp  v0.4s, v0.4s
        str     q0, [x8]
        ret

example::f32x4::floor:
        ldr     q0, [x0]
        frintm  v0.4s, v0.4s
        str     q0, [x8]
        ret

example::f32x4::round:
        ldr     q0, [x0]
        frinta  v0.4s, v0.4s
        str     q0, [x8]
        ret

example::f32x4::trunc:
        ldr     q0, [x0]
        frintz  v0.4s, v0.4s
        str     q0, [x8]
        ret

example::f32x4::mul_add:
        ldr     q0, [x0]
        ldr     q1, [x1]
        ldr     q2, [x2]
        fmla    v2.4s, v1.4s, v0.4s
        str     q2, [x8]
        ret

example::f32x4::abs:
        ldr     q0, [x0]
        fabs    v0.4s, v0.4s
        str     q0, [x8]
        ret

example::f32x4::sqrt:
        ldr     q0, [x0]
        fsqrt   v0.4s, v0.4s
        str     q0, [x8]
        ret
</code></pre></div>



<a name="234953166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234953166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234953166">(Apr 17 2021 at 02:44)</a>:</h4>
<p>It's a great instruction set</p>



<a name="234956294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234956294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234956294">(Apr 17 2021 at 03:39)</a>:</h4>
<p>upsetting that drop_in_place is still visible</p>



<a name="234956367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234956367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234956367">(Apr 17 2021 at 03:40)</a>:</h4>
<p>has to be for any trait object</p>



<a name="234956376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234956376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234956376">(Apr 17 2021 at 03:40)</a>:</h4>
<p>the dtor is referenced in the vtable</p>



<a name="234956749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234956749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234956749">(Apr 17 2021 at 03:49)</a>:</h4>
<p>i guess it's called from fmt?</p>



<a name="234956901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234956901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234956901">(Apr 17 2021 at 03:53)</a>:</h4>
<p>yeah.</p>



<a name="234959219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/234959219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#234959219">(Apr 17 2021 at 04:41)</a>:</h4>
<p>well at least it's not as bad as the assembly for the instruction_set attribute</p>



<a name="236095515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095515">(Apr 25 2021 at 21:34)</a>:</h4>
<p>Should we document <strong>known</strong> vectorization "inflection points"?</p>



<a name="236095541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095541">(Apr 25 2021 at 21:35)</a>:</h4>
<p>What do you mean by that?</p>



<a name="236095553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095553">(Apr 25 2021 at 21:35)</a>:</h4>
<p>"on SSE3, this is probably scalarized, on SSE4.1, this is probably vectorized."</p>



<a name="236095643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095643">(Apr 25 2021 at 21:36)</a>:</h4>
<p>We could be slightly nebulous by saying things like "recommended with SSE3 and better on x86_64".</p>



<a name="236095668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095668">(Apr 25 2021 at 21:37)</a>:</h4>
<p>I don't think we should do that because it depends on the function</p>



<a name="236095677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095677">(Apr 25 2021 at 21:37)</a>:</h4>
<p>oh yeah I meant on a function-by-function basis.</p>



<a name="236095679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095679">(Apr 25 2021 at 21:37)</a>:</h4>
<p>And it would get very confusing very fast for something supposedly portable</p>



<a name="236095698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095698">(Apr 25 2021 at 21:38)</a>:</h4>
<p>lol, tru.</p>



<a name="236095731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095731">(Apr 25 2021 at 21:38)</a>:</h4>
<p>We already have a path forward through a vector math lib</p>



<a name="236095753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Avoiding%20Scalar%20Fallbacks%20/%20Verifying%20Vectorization/near/236095753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Avoiding.20Scalar.20Fallbacks.20.2F.20Verifying.20Vectorization.html#236095753">(Apr 25 2021 at 21:39)</a>:</h4>
<p>yeah, just <em>gurgling noises</em></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>